package top.tocchen.bookshop.util;

import top.tocchen.bookshop.entity.CartDoEntity;

import java.util.List;

/**
 *
 */
public class GetAllPrice {
    public static double getAllPrice(List<CartDoEntity> cartDos){
        double price=0;
        for (CartDoEntity cartDo: cartDos
             ) {
            price += cartDo.getBook().getPrice() * cartDo.getCount();
        }
        return price;
    }

}
